{template 'header.html'}

<div id="bd">
    	{template 'left.html'}
      <div id="bd_rightg">
        <div class="rightg_content">
		{template 'position.html'}
        	
            <div class="content2">
            <div class="pd_title">{$archive[title]}</div>


<div class="contentinfo">{lang(author)}：<a href="javascript:void(0);" onclick="javascript:document.getElementById('addcontentuser').style.display='block';">{$archive[author]}</a>&nbsp;&nbsp; {lang(adddate)}：{$archive[adddate]}&nbsp;&nbsp; {lang(view)} :{view_js($archive[aid])}</div>



<style>
.frame {
  width:660px;
  height:440px;
  overflow:hidden;
  vertical-align:middle;
 }
 .frame .list {
  list-style:none;
  padding:0;
  margin:0;
  width:10000px;
 }
 .frame .list li {
  width:660px;
  height:440px;
  float:left;
  text-align:center;
  vertical-align:middle;
  overflow:hidden;
 }


 
 .l_frame {
  width:628px;
  float:left;
  overflow:hidden;
 }

 .l_frame .list {
  list-style:none;
  padding:0;
  margin:0;
  width:10000px;
 }
 .l_frame .list li {
  float:left;
  width:100px;
  height:100px;
  cursor:pointer;
  margin:0px 2px;
 }
 .l_frame .list li img {width:100px;height:100px;max-height:100px;}
 .l_frame .list .cur {
 height:100px;
 overflow:hidden;
  border:3px solid #ccc;
 }

 .slide_nav_left {
  height:100px;
  width:16px;
  background:url({$base_url}/images/goleft.gif) left center no-repeat;
  display:block;
  float:left;
  text-indent:-10000px;
 }

 .slide_nav_right {
  height:100px;
  width:16px;
  background:url({$base_url}/images/goright.gif) left center no-repeat;
  display:block;
  float:left;
  text-indent:-10000px;
 }

 #frame {margin:10px 0px 10px 36px;}

 </style>

<div class="blank30"></div>
<!-- 幻灯片 -->
<div id="frame">
<?php $pics = array_values(unserialize($archive[pics])); ?>
{if $pics}


<a id="back" class="slide_nav_left" href="#">left</a>
<div id="small_frame" class="l_frame">
 <ul id="small_list" class="list">
   {loop $pics $pic}<li><img src="{$pic}" onerror='this.src="{$base_url}/{config::get('onerror_pic')}"' /></li>{/loop}
 </ul>
</div>
<a id="forward" class="slide_nav_right" href="#">right</a>

<div class="blank30"></div>

<div id="big_frame" class="frame">
 <ul id="big_list" class="list">
  {loop $pics $pic}<li><img src="{$pic}" onerror='this.src="{$base_url}/{config::get('onerror_pic')}"' /></li>{/loop}
 </ul>
</div>


<!--slides_nav end-->
</div>


{/if}



<div class="blank30"></div>
<!-- 正文 -->
<div id="content" style="width:710px;margin:0px 10px;">
{$archive[content]}

<div class="blank30"></div>


{if $archive[attr2]}
<!-- tag -->
<div class="blank10"></div>
{lang(productprice)}： {$archive[attr2]}
{/if}

{if $archive[tag]}
<!-- tag -->
<div class="blank10"></div>
{lang(tag)}： {$archive[tag]}
{/if}

{if $archive[special]}
<!-- 专题 -->
<div class="blank10"></div>
{lang(special)}： {$archive[special]}
{/if}


{if $archive[type]}
<!-- 分类 -->
<div class="blank10"></div>
{lang(type)}： {$archive[type]}
{/if}


{if $archive[area]}
<!-- 地区 -->
<div class="blank10"></div>
{lang(area)}： {$archive[area]}
{/if}

<div class="blank30"></div>
{if $pages>1}
<!-- 内页分页 -->
<div class="blank10"></div>
<div class="pages">
{archive_pagination($archive)}
</div>
<div class="blank30"></div>
{/if}

<!--自动调用自定义字段-->
<?php
$set_field=type::getpositionlink($data['typeid']);
$set_fields=array();
if(is_array($set_field))
foreach($set_field as $key => $value) {
    $set_fields[]=$value[id];
}
?>
{cb_data($archive)}
{loop $archive $key $value}
<?php if(setting::$var['archive'][$name]['typeid'] && !in_array(setting::$var['archive'][$name]['typeid'],$set_fields)){
  unset($field[$name]);
  continue;
}?>
<?php if(!preg_match('/^my/',$key) || !$value) continue; ?>
<p> {=setting::$var['archive'][$key]['cname']}: {$value}</p>
{/loop}
<div class="blank20"></div>


<?php if(archive_attachment($archive['aid'],'id')) { ?>
<!-- 附件 -->
<p>
{lang(attachment)}：{attachment_js($archive['aid'])}
</p>
<?php } ?>
<div class="blank30"></div>

<?php if(hasflash()) { ?>
        <div style="color:red;font-size:16px;"><?php echo showflash(); ?></div><?php } ?>

<!-- 投票 -->
        {vote_js($archive[aid])}

<!-- 自定义表单开始 -->
{if $archive['showform']}<div class="blank30"></div>
{template 'myform/nrform.html'}
{/if}
<!-- 自定义表单结束 -->


<script language="JavaScript">
function shutwin(){
window.close();
return;}
</script>
{if get('lang_type')=='cn'}
<div class="blank30"></div>
<!-- JiaThis Button BEGIN -->
<div id="ckepop" style="margin-left:10px;">
<a href="http://www.jiathis.com/share/" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank">分享到：</a>
<a class="jiathis_button_tools_1"></a>
<a class="jiathis_button_tools_2"></a>
<a class="jiathis_button_tools_3"></a>
<a class="jiathis_button_tools_4"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END -->
{/if}
<div class="blank30"></div>
<div id="tool">
<ul>
<li><a href="javascript:window.print()" class="print">{lang(printcontent)}</a></li>
<li><a href="javascript:shutwin()" class="close">{lang(shutwin)}</a></li>
<li style="width:90px; padding-left:5px;"><a href='<?php echo url('comment/list/aid/'.$archive['aid']); ?>' class="t_4">{lang(comment)}</a></li>
<li style="width:60px; padding-left:5px;">{lang(strgrades)}：</li>
<li style="width:100px; padding-left:5px;">{$archive[strgrade]}</li>
{if $archive[attr2]}
<li><a title="{lang(makeorders)}" target="_blank" href="{url('archive/orders/aid/'.$archive[aid],true)}" class="orders">{lang(makeorders)}</a></li>
{/if}
</ul>
</div>
<div class="blank30"></div>
<div id="page">
{if $archive['p']['aid']}
<strong>{lang(archivep)}：</strong><a href="{$archive['p']['url']}">{$archive['p']['title']}</a>
{else}
<strong>{lang(archivep)}：</strong>{lang(nopage)}	
{/if}
<div class="clear"></div>
{if $archive['n']['aid']}
 <strong>{lang(archiven)}：</strong><a href="{$archive['n']['url']}">{$archive['n']['title']}</a>
{else}
<strong>{lang(archiven)}：</strong>{lang(nopage)}	
{/if}
</div>


<div class="blank30"></div>
		<a title="{lang(gotop)}" href="#" class="clear floatright"><img alt="{lang(gotop)}" src="{$skin_url}/gotop.gif"></a>
	<div class="clear"></div></div>
            </div>
</div>

      <div class="clear"></div>
    </div>
</div>

<script type="text/javascript">
//初始化
function C_slider(frame,list,Lframe,Llist,forwardEle,backEle,scrollType,LscrollType,acitonType,autoInterval){
 this.frame = frame;
 this.list = list;
 this.Lframe = Lframe;
 this.Llist = Llist;
 this.forwardEle = forwardEle;
 this.backEle = backEle;
 this.scrollType = scrollType;
 this.LscrollType = LscrollType;
 this.acitonType = acitonType;
 this.autoInterval = autoInterval;
 this.slideLength = $("#"+this.Llist+" > li").length;//总的slider数量
 this.currentSlide = 0;
 this.FrameHeight = $("#"+this.frame).height();
 this.FrameWidth = $("#"+this.frame).width();
 this.lFrameHeight = $("#"+this.Lframe).height();
 this.lFrameWidth = $("#"+this.Lframe).width();
 this.lListHeight = $("#"+this.Llist+" >li").eq(0).outerHeight(true);
 this.lListWidth = $("#"+this.Llist+" >li").eq(0).outerWidth(true);
 var self = this;
 for(var i = 0; i<this.slideLength; i++) {
  $("#"+this.Llist+" > li").eq(i).data("index",i);
  $("#"+this.Llist+" > li").eq(i).bind(this.acitonType,function(){
   self.go($(this).data("index"));
  });
 };
 //给"上一个"、"下一个"按钮添加动作
 $("#"+this.forwardEle).bind('click',function(){
  self.forward();
  return false;
 });
 $("#"+this.backEle).bind('click',function(){
  self.back();
  return false;
 });
 //定论鼠标划过时，自动轮换的处理
 $("#"+this.frame+",#"+this.Lframe+",#"+this.forwardEle+",#"+this.backEle).bind('mouseover',function(){
  clearTimeout(self.autoExt);
 });
 $("#"+this.frame+",#"+this.Lframe+",#"+this.forwardEle+",#"+this.backEle).bind('mouseout',function(){
  clearTimeout(self.autoExt);
  self.autoExt = setTimeout(function(){
   self.extInterval();
  },self.autoInterval);
 }); 
 //开始自动轮换
 this.autoExt = setTimeout(function(){
  self.extInterval();
 },this.autoInterval);
}
//执行运动
C_slider.prototype.go = function(index){
 this.currentSlide = index;
 if (this.scrollType == "left"){
  $("#"+this.list).animate({
   marginLeft: (-index*this.FrameWidth)+"px"
  }, {duration:600,queue:false});   
 } else if (this.scrollType == "top"){
  $("#"+this.list).animate({
   marginTop: (-index*this.FrameHeight)+"px"
  }, {duration:600,queue:false});   
 }
 $("#"+this.Llist+" > li").removeClass("cur");
 $("#"+this.Llist+" > li").eq(index).addClass("cur");
 //对于缩略图的滚动处理
 if(this.LscrollType == "left"){
  if(this.slideLength*this.lListWidth > this.lFrameWidth){
   var spaceWidth = (this.lFrameWidth - this.lListWidth)/2;
   var hiddenSpace = this.lListWidth*this.currentSlide - spaceWidth;
   
   if (hiddenSpace > 0){
    if(hiddenSpace+this.lFrameWidth <= this.slideLength*this.lListWidth){
     $("#"+this.Llist).animate({
      marginLeft: -hiddenSpace+"px"
     }, {duration:600,queue:false}); 
    } else {
     var endHidden = this.slideLength*this.lListWidth - this.lFrameWidth;
     $("#"+this.Llist).animate({
      marginLeft: -endHidden+"px"
     }, {duration:600,queue:false}); 
    }
   } else {
    $("#"+this.Llist).animate({
     marginLeft: "0px"
    }, {duration:600,queue:false}); 
   }
  }
 } else if (this.LscrollType == "top"){
  if(this.slideLength*this.lListHeight > this.lFrameHeight){
   var spaceHeight = (this.lFrameHeight - this.lListHeight)/2;
   var hiddenSpace = this.lListHeight*this.currentSlide - spaceHeight;
   if (hiddenSpace > 0){
    if(hiddenSpace+this.lFrameHeight <= this.slideLength*this.lListHeight){
     $("#"+this.Llist).animate({
      marginTop: -hiddenSpace+"px"
     }, {duration:600,queue:false}); 
    } else {
     var endHidden = this.slideLength*this.lListHeight - this.lFrameHeight;
     $("#"+this.Llist).animate({
      marginTop: -endHidden+"px"
     }, {duration:600,queue:false}); 
    }
   } else {
    $("#"+this.Llist).animate({
     marginTop: "0px"
    }, {duration:600,queue:false}); 
   }
  }
 }
}
//前进
C_slider.prototype.forward = function(){
 if(this.currentSlide<this.slideLength-1){
  this.currentSlide += 1;
  this.go(this.currentSlide);
 }else {
  this.currentSlide = 0;
  this.go(0);
 }
}
//后退
C_slider.prototype.back = function(){
 if(this.currentSlide>0){
  this.currentSlide -= 1;
  this.go(this.currentSlide);
 }else {
  this.currentSlide = this.slideLength-1;
  this.go(this.slideLength-1);
 }
}
//自动执行
C_slider.prototype.extInterval = function(){
 if(this.currentSlide<this.slideLength-1){
  this.currentSlide += 1;
  this.go(this.currentSlide);
 }else {
  this.currentSlide = 0;
  this.go(0);
 }
 var self = this;
 this.autoExt = setTimeout(function(){
  self.extInterval();
 },this.autoInterval);
}
//实例化对象 
var goSlide1 = new C_slider("big_frame","big_list","small_frame","small_list","forward","back","left","left","click",3000);
var goSlide2 = new C_slider("big_frame2","big_list2","small_frame2","small_list2","forward2","back2","top","left","click",5000);
var goSlide3 = new C_slider("big_frame3","big_list3","small_frame3","small_list3","forward3","back3","left","top","click",3000);
var goSlide4 = new C_slider("big_frame4","big_list4","small_frame4","small_list4","forward4","back4","top","top","click",2000);
</script>

<script> 
function resizeImg(obj)
{ 
var obj = document.getElementById(obj); 
var objContent = obj.innerHTML;
var imgs = obj.getElementsByTagName('img'); 
if(imgs==null) return; 
for(var i=0; i<imgs.length; i++) 
{ 
if(imgs[i].width>parseInt(obj.style.width)) 
{ 
imgs[i].width = parseInt(obj.style.width);
} 
} 
} 
window.onload = function() {resizeImg('content');
} 
</script>
{template 'footer.html'}